var lyyApplication={
    //start-using 数据启用禁用状态 0：启用 1：禁用
    test:function () {
        alert("lyyApplication")
    },
    initStatus:function (data, type) {
        switch(type)
        {
            case "start-using"://启用禁用
                if (data===1){
                    return "<span class='label label-success radius'>启用</span>" ;
                }else if(data===0){
                    return "<span class='label radius'>禁用</span>" ;
                }else {
                    return "<span class='label label-danger radius'>未知状态</span>" ;
                }
                break;
            case "processType"://流程业务类型
                switch (data){
                    case 1:
                        return "<span class='label label-primary radius'>自检流程</span>";
                        break;
                    case 2:
                        return "<span class='label label-success radius'>普通流程</span>";
                        break;
                    default:
                        return "";
                }
                break;
            case "processState"://流程状态
                switch (data){
                    case 1:
                        return "<span class='label label-primary radius'>发起流程</span>";
                        break;
                    case 2:
                        return "<span class='label label-primary radius'>已审核</span>";
                        break;
                    case 3:
                        return "<span class='label label-primary radius'>已领取</span>";
                        break;
                    case 4:
                        return "<span class='label label-primary radius'>已处理待测试</span>";
                        break;
                    case 5:
                        return "<span class='label label-primary radius'>已处理</span>";
                        break;
                    case 6:
                        return "<span class='label label-success radius'>已归档</span>";
                        break;
                    case 10:
                        return "<span class='label label-danger radius'>已取消</span>";
                        break;
                    default:
                        return "";
                }
                break;
            case "bool"://是否
                if (data===1){
                    return "<span class='label label-success radius'>是</span>" ;
                }else if(data===0){
                    return "<span class='label radius'>否</span>" ;
                }else {
                    return "<span class='label label-danger radius'>未知状态</span>" ;
                }
                break;
            case "handleResult"://流程处理结果
                if (data===1){
                    return "<span class='label label-success radius'>成功处理</span>" ;
                }else if(data===0){
                    return "<span class='label radius'>未处理成功</span>" ;
                }else {
                    return "<span class='label label-danger radius'>未知状态</span>" ;
                }
                break;
            case "testResult"://流程测试结果
                if (data===1){
                    return "<span class='label label-success radius'>测试通过</span>" ;
                }else if(data===0){
                    return "<span class='label radius'>测试未通过</span>" ;
                }else {
                    return "<span class='label label-danger radius'>未知状态</span>" ;
                }
                break;
            case "priorityResult"://紧急程度
                switch (data){
                    case 1:
                        return "<span class='label label-primary radius'>一般</span>";
                        break;
                    case 2:
                        return "<span class='label label-warning radius'>稍急</span>";
                        break;
                    case 3:
                        return "<span class='label label-danger radius'>紧急</span>";
                        break;
                    default:
                        return "";
                }
                break;

        }
    },
    util:{
        isEmpty:function (v) {
            switch (typeof v) {
                case 'undefined':
                    return true;
                case 'string':
                    if (v.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
                    break;
                case 'boolean':
                    if (!v) return true;
                    break;
                case 'number':
                    if (0 === v || isNaN(v)) return true;
                    break;
                case 'object':
                    if (null === v || v.length === 0) return true;
                    for (var i in v) {
                        return false;
                    }
                    return true;
            }
            return false;
        }

    }

};